package cz.muni.fi.pa165.rentalofconstructionmachinery;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


/**
 *
 * @author stefan.rakonjac
 */
public enum CustomerType {
    PHYSICAL("physical"),
    LEGAL("legal");
    
    private final String type;
        
    CustomerType(String type) {
        this.type = type;
    }
    
    public String type() {
        return this.type;
    }
    
    public static CustomerType fromString(String text) {
        if (text != null) {
            for (CustomerType b : CustomerType.values()) {
                if (text.equalsIgnoreCase(b.type)) {
                    return b;
                }
            }
        }
        throw new IllegalArgumentException("No constant with text " + text + " found");
    }
    
}
